<template>
	<view class="d-kuan d-neirong-juzhong">
		<!-- #ifdef H5 -->
			<view> 您目前是移动网页端</view>
			<view> 请在微信打开二维码扫描功能</view>
		<!-- #endif -->
		<!-- #ifdef APP-PLUS -->
			<view @click="getErweima()">
				打开
				
			</view>
		<!-- #endif -->
		
	</view>
</template>

<script>
	
export default {
	components: {
		
	},
    data() {
		return {
			keycode:'',
			uid:''
		}
	},
	onLoad() {
		var duixin = this;
		duixin.getDangqianurl();//获取当前网址
		//duixin.getErweima();
		uni.setNavigationBarTitle({
		title: '扫描二维码'
		});
		var keycode = uni.getStorageSync('keycode');
		duixin.keycode = keycode;
		var uid = uni.getStorageSync('memberuid');
		duixin.uid = uid;
	},
	methods: {
		//获取当前页面
		getDangqianurl() {
			//获取当前页面栈的实例
			let pages = getCurrentPages();
			//获取当前页面
			let currentPage = pages[pages.length-1].$page.fullPath;
			let url = currentPage;
			uni.setStorageSync('dangqianUrl', url);
		},
		//扫描二维码
		getErweima(){
			uni.scanCode({				success: res => {				  console.log('扫描成功',res)				  // 在这里处理扫描结果				},				fail: err => {				  console.log('扫描错误',err)				  // 在这里处理扫描失败的情况				}			})
		}
		
	}
};
</script>

<style>
</style>